//
//  ScenicStoryModel.swift
//  LeTu
//
//  Created by g1 on 2024/1/16.
//

import Foundation

class ScenicStoryModel: Mappable, Equatable {
    
    var chineseAudioName = ""
    var chineseAudioUrl = ""
    var chineseText = ""
    var createTime = ""
    var englishAudioName = ""
    var englishAudioUrl = ""
    var englishText = ""
    var id = 18
    var interpretType = 1
    var name = ""
    var payStatus = 1
    var remarks = ""
    var scenicId = 1
    var sort = 11
    var status = 0
    var updateTime = ""
    
    var finalAudioUrl: String {
        return LanguageManager.shared.currentLanguage == .zh ? chineseAudioUrl:englishAudioUrl
    }
    
    init() {
        
    }
    
    required init?(map: ObjectMapper.Map) {
        
    }
    
    func mapping(map: ObjectMapper.Map) {
        
        chineseAudioName <- map["chineseAudioName"]
        chineseAudioUrl <- map["chineseAudioUrl"]
        chineseText <- map["chineseText"]
        createTime <- map["createTime"]
        englishAudioName <- map["englishAudioName"]
        englishAudioUrl <- map["englishAudioUrl"]
        englishText <- map["englishText"]
        id <- map["id"]
        interpretType <- map["interpretType"]
        name <- map["name"]
        payStatus <- map["payStatus"]
        remarks <- map["remarks"]
        scenicId <- map["scenicId"]
        sort <- map["sort"]
        status <- map["status"]
        updateTime <- map["updateTime"]
        
    }
    
    static func == (lhs: ScenicStoryModel, rhs: ScenicStoryModel) -> Bool {
        return lhs.chineseAudioName == rhs.chineseAudioName &&
        lhs.chineseAudioUrl == rhs.chineseAudioUrl &&
        lhs.chineseText == rhs.chineseText &&
        lhs.id == rhs.id
    }
    
}
